package com.xiaolin.structure.tree.complete;

import com.xiaolin.structure.tree.node.Node;
import lombok.Data;
import lombok.ToString;

/**
 * @ClassName BinaryTree
 * @Description 完全二叉树-链表实现
 * @Detail detail
 * @Author MyPC
 * @Date 2020/12/24
 * @Version 1.0
 */
public class BinaryTree<E> {
    // 根节点
    private Node<E> root;

    public void setRoot(Node<E> root) {
        this.root = root;
    }

    public Node<E> getRoot() {
        return root;
    }

    /**
     * 生成一棵完全二叉树
     * @param array
     * @return
     */
    public Node<E> generateTree(E[] array){

        return root;
    }

    /**
     * 添加节点
     * @param e
     * @return
     */
    public boolean addNode(E e){
        return false;
    }

    /**
     * @ClassName Student
     * @Description TODO
     * @Detail detail
     * @Author MyPC
     * @Date 2020/11/17
     * @Version 1.0
     */
    @Data
    @ToString
    public static class Student {
        private int age;
        private String name;
        public Student(int age,String name){
            this.age=age;
            this.name=name;
        }
    }
}
